package zaphod.toy.sampleserver;

import java.io.IOException;
import java.io.InputStream;


public class InputThread implements Runnable
{

    private final InputStream is;


    public InputThread( InputStream inputStream )
    {
        this.is = inputStream;
    }


    public void run()
    {
        int i;
        char c;
        try
        {
            while ( true )
            {
                i = is.read();
                if ( i == -1 )
                {
                    break;

                }
                c = (char)i;
                System.out.print( c );
            }

        }
        catch ( IOException e )
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}
